// 导入 router
import { createRouter, createWebHistory } from 'vue-router';
// 导入路由各页面配置
import routes from './routes'
// 配置router对象
const router = createRouter({
    history: createWebHistory(),
    routes,

})
// 通过全局前置守卫进行设置标签页名称
router.beforeEach((to, from, next) => {
    const { meta: { title } } = to;
    document.title = title || 'My Favorite';
    next()
})
export default router;